home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / NeXTmj / Source / TileIterator.h < prev   
C/C++ Source or Header  |  1991-03-16  |  965b  |  46 lines

  1.  
  2. /*
  3.  * This is used to interate through an array
  4.  *    of tiles in a modulas fashion.
  5.  *
  6.  $Author$
  7.  $Header$
  8.  *
  9.  $Log$
  10.  */
  11.  
  12.  
  13. class TileIterator {
  14. private:
  15.                                                 // This is the integral value of
  16.                                                 //    this object.
  17.  
  18.     int        my_value;
  19.  
  20. public:
  21.                                                 // Return the current value of the 
  22.                                                 //    object.
  23.     int        value( void );
  24.                                                 // The iterator operator increments
  25.                                                 //    the value modulas the number of
  26.                                                 //    tiles and retuns the next value.
  27.     int        operator()();
  28.                                                 // Add to the value.
  29.     int        operator+( int );
  30.                                                 // Subrtact from the value.
  31.     int        operator-( int );                    
  32.                                                 // Preincrement.  Postincrement isn't
  33.                                                 //    supported by the compiler.
  34.     int        operator++( void );
  35.                                                 // Predecrement.  Postdecrement may not be
  36.                                                 //    supported.
  37.     int        operator--( void );
  38.                                                 // Assign a value.
  39.     void    operator=( int );
  40.     
  41.     
  42.     TileIterator( void );
  43.     TileIterator( int );
  44. };
  45.  
  46.